package com.itheima.a01mymap;

import java.util.TreeMap;

public class A04_TreeMapDemo2 {
    public static void main(String[] args) {
        //创建集合对象
        TreeMap<Student3,String> tm=new TreeMap<>();

        //创建学生对象
        Student3 s3=new Student3("ee",19);
        Student3 s4=new Student3("rr",21);
        Student3 s2=new Student3("ww",19);
        Student3 s1=new Student3("qq",19);

        //添加到集合
        tm.put(s1,"北京");
        tm.put(s2,"福建");
        tm.put(s3,"上海");
        tm.put(s4,"江西");

        //打印集合
        System.out.println(tm);
    }
}
